html,
body {
    /* 初始化样式 */
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* 方便子元素设置高度百分百 */
    position: relative;
    width: 100%;
    height: 100%;
    background: rgba(200, 212, 212, .2) url(../images/index-tree.jpg) no-repeat center center;
    background-size: cover;
}

/*欢迎语样式*/

@font-face {
    font-family: Pinyon;
    src: url("../fonts/PinyonScript-Regular.ttf");
}

@keyframes flash {
    0% {
        text-shadow: 0 0 4px #ddedc7
    }
    50% {
        text-shadow: 0 0 40px #efe814
    }
    100% {
        text-shadow: 0 0 4px #ccef06
    }
}

h1 {
    position: absolute;
    left: 50%;
    margin: 10px;
    transform: translateX(-50%);
    top: 0;
    font-family: Pinyon;
    font-size: 46px;
    animation: flash 1.75s ease-in infinite;
}


/* h2设置 */

@font-face {
    font-family: Fanti;
    src: url("../fonts/JiZiJingDianXingKaiJianFan-Shan\(GEETYPE-XingKaiGBT-Flash\)-2.ttf");
}

@keyframes flip {
    0% {
        transform: perspective(400px) rotateY(0);
        animation-timing-function: ease-out;
    }
    40% {
        transform: perspective(400px) translateZ(150px) rotateY(170deg);
        animation-timing-function: ease-out;
    }
    50% {
        transform: perspective(400px) translateZ(150px) rotateY(190deg) scale(1);
        animation-timing-function: ease-in;
    }
    80% {
        transform: perspective(400px) rotateY(360deg) scale(.95);
        animation-timing-function: ease-in;
    }
    100% {
        transform: perspective(400px) scale(1);
        animation-timing-function: ease-in;
    }
}
h2 {
    position: absolute;
    left: 38%;
    top: 20%;
    font-size: 46px;
    font-family: Fanti;
    -webkit-animation: flip 1.75s .2s ease both;
    -webkit-backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    -ms-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* 按钮的css */

.button a {
    position: absolute;
    top: 80%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(0, 255, 255, 0.6);
    padding: 30px 60px;
    font-size: 30px;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* 按钮悬浮效果 */

.button a:hover {
    color: rgb(243, 10, 10);
}

/* 解决overflow无效问题 */

.button a:before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    bottom: 2px;
    width: 50%;
    background: rgba(255, 255, 255, 0.05);
}

/* 上面从左往右的线条 */

@keyframes leftToRight {
    0% {
        transform: translateX(-100%);
        -webkit-transform: translateX(-100%);
        -moz-transform: translateX(-100%);
        -ms-transform: translateX(-100%);
        -o-transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
        -webkit-transform: translateX(100%);
        -moz-transform: translateX(100%);
        -ms-transform: translateX(100%);
        -o-transform: translateX(100%);
    }
}

.button a span:nth-child(1) {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, #005597, aqua);
    animation: leftToRight 2s linear infinite;
    -webkit-animation: leftToRight 2s linear infinite;
}

/* 从上至下的线条 */

@keyframes topToBottom {
    0% {
        transform: translateY(-100%);
        -webkit-transform: translateY(-100%);
        -moz-transform: translateY(-100%);
        -ms-transform: translateY(-100%);
        -o-transform: translateY(-100%);
    }
    100% {
        transform: translateY(100%);
        -webkit-transform: translateX(100%);
        -moz-transform: translateX(100%);
        -ms-transform: translateX(100%);
        -o-transform: translateX(100%);
    }
}

.button a span:nth-child(2) {
    position: absolute;
    top: 0;
    right: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, #005597, aqua);
    animation: topToBottom 2s linear infinite;
    -webkit-animation: topToBottom 2s linear infinite;
    /* 动画延迟时间*/
    animation-delay: 1s;
}

/* 从右往左的线条 */

@keyframes rightToLeft {
    0% {
        transform: translateX(100%);
        -webkit-transform: translateX(100%);
        -moz-transform: translateX(100%);
        -ms-transform: translateX(100%);
        -o-transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
        -webkit-transform: translateX(-100%);
        -moz-transform: translateX(-100%);
        -ms-transform: translateX(-100%);
        -o-transform: translateX(-100%);
    }
}

.button a span:nth-child(3) {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to left, #005597, aqua);
    animation: rightToLeft 2s linear infinite;
    -webkit-animation: rightToLeft 2s linear infinite;
    animation-delay: 1s;
}

/* 从下往上的线条 */

@keyframes bottomToTop {
    0% {
        transform: translateY(100%);
        -webkit-transform: translateY(100%);
        -moz-transform: translateY(100%);
        -ms-transform: translateY(100%);
        -o-transform: translateY(100%);
    }
    100% {
        transform: translateY(-100%);
        -webkit-transform: translateY(-100%);
        -moz-transform: translateY(-100%);
        -ms-transform: translateY(-100%);
        -o-transform: translateY(-100%);
    }
}

.button a span:nth-child(4) {
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(to top, #005597, aqua);
    animation: bottomToTop 2s linear infinite;
    -webkit-animation: bottomToTop 2s linear infinite;
    /* add delay to have continuity on effect*/
    animation-delay: 1s;
}